<template>
	<view>
		<view class="inform" v-if="value.hasOwnProperty('id')"  @click="urlClick()">
			你有未完成的：{{value.questions.name}}，点此继续
		</view>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				user_id : uni.getStorageSync("user_id"),
				value : []
			}
		},
		created() {
			var keys  =  'questions'+this.user_id;
			this.value  = uni.getStorageSync(keys);
			if(this.value){
				this.value  = JSON.parse(this.value);
			}
		},
		methods: {
			urlClick(){
				var query    = 'id='+this.value.id;
				console.log(this.value.query);
				if(this.value.query.hasOwnProperty('lid')){
					query += '&lid='+this.value.query.lid;
				}
				if(this.value.query.hasOwnProperty('bid')){
					query += '&bid='+this.value.query.bid;
				}
				if(this.value.query.hasOwnProperty('is_date')){
					query += '&is_date='+this.value.query.is_date;
				}
				uni.navigateTo({
					url: '/pages/questions/questions?'+query
				})
				
			}
		}
	}
</script>

<style lang="less">
	.inform {
		font-size: 28rpx;
		padding-left: 38rpx;
		width: 750rpx;
		background-color: #fff3cd;
		color: #856404;
		line-height: 86rpx;
		margin-top: 20rpx;
		margin-bottom: 20rpx;
		border: 2rpx solid #f5e5b3;
	}
</style>